package bcxd.firstline.credit.machining;

import java.sql.Connection;

import jt.classic.system.context.ISystemContext;
import jt.classic.system.user.IUser;

import org.limp.basework.MachiningException;
import org.limp.basework.SimpleBean;
import org.limp.basework.SimpleBeanMachining;
import org.limp.basework.Table;
import org.limp.basework.impl.CommonBean4HSQ;
import org.limp.mine.DateTrimmer;

/**
 * 授信机构授信审核
 * 
 * @author mido
 * 
 */
public class CreditAuditMachining implements SimpleBeanMachining {

	public SimpleBean machining(SimpleBean bean, Table table,
			CommonBean4HSQ cbh, Connection conn, int type)
			throws MachiningException {
		// TODO Auto-generated method stub
		if (type == -4) {
			if (ISystemContext.invalidSesstion(cbh.getRequest())) {
				throw new MachiningException("invalid session.");
			}
			// 更新会话用户对象信息
			IUser user = ISystemContext.getSessionUser(cbh.getRequest());
			
			bean.getResource().put("au_date", DateTrimmer.getYMDHMS());
			bean.getResource().put("au_creditid", user.id());
			bean.getResource().put("au_creditname", user.iname());
		}
		return null;
	}

}
